<@mits.headerDiv />
<div class="Main" id="Main">
	<!--屏幕切换-->
   
    
    
	<!--左边-->
	<!--右边-->
	<div class="Main_body" id="Main_body">
			  <div class="Main_bodyListBar">
				<div class="Main_bodyListBar_head"><span>用户信息</span> </div>
		<@mits.showActionMsg />
	    <div class="Main_bodyListBar_body">
	   <table border="0" cellspacing="1" cellpadding="0" class="addTable" >
				  	<form name="editUserForm" id="editUserForm" action="" method="post">
				  	<input type="hidden" name="user.id" id="user.id" value="${user.id?if_exists}">
						<tr>
							<td class="title">用户账号：<font color="red">*</font></td>
							<td class="content2" colspan="3">${user.userName?if_exists?html}<input type="hidden" name="user.userName" id="user.userName" maxlength="50" value="${user.userName?if_exists}" class="input_short"/></td>
					 		
					  	</tr>

						<tr  bgcolor="#f9faf5">
							<td class="title">密码：<font color="red">*</font></td>
							<td class="content"><input type="password"  name="user.password" id="user.password" dataType="Require" maxlength="20"  msg='密码不能为空,长度不能超过20' value="${user.password?if_exists?html}"  class="input_short"/></td>
					  
							<td class="title">确认密码：</td>
					    	<td class="content">
							<input type="password"  name="password1" id="password1"  maxlength="20" value="${user.password?if_exists?html}"  class="input_short"/><span id="psdErrorMsg"></span></td>
					  	</tr>

						<tr>
							<td class="title">用户角色：</td>
							<td class="content">
							
							<select name="user.role.id" >
							<#if roles?exists><#list roles as role><option <#if role.id == user.role.id>selected</#if> value="${role.id?if_exists}">${role.roleName?if_exists?html}</option> </#list></#if></select>
							</td>

					  
                          	<td class="title">用户姓名：</td>
						  	<td class="content"><input type="text"  name="user.name" id="user.name" value="${user.name?if_exists?html}"  maxlength="50" class="input_short"/></td>
					  	</tr>
						
						<tr>
                          <td class="title">所属部门：</td>
						  <td class="content"><select id="user.department.id" name="user.department.id">
			                <option value="-1" >请选择部门</option>
			               
			                <#if allDepartments?exists>
			                <#list allDepartments as department>
			                <option value="${department?if_exists.id?if_exists}" <#if user.department?exists><#if user.department.id == department.id >selected</#if></#if>>${department?if_exists.departmentName?if_exists}</option>
			                </#list>
			                </#if>
			                </select> 
						 </td>
                          <td class="title">用户状态：</td>
						  <td class="content">
						  <input type="radio" name="user.status" value="1"  <#if user.status == 1>checked</#if> />有效
						  <input type="radio" name="user.status" value="0"  <#if user.status == 0>checked</#if> />禁用
						  </td>
					  	</tr>
					</form>
					</table>
				
                    <br />

			</div>
				<div class="Main_bodyListBar_bottom">
				  <div class="Main_bodyListBar_button">
				  <input type="button" class="button" onclick="saveUser()" value="保存" /> 
				   <input type="button" class="button" onclick="window.location='${base}/auth/system/userList.action?cleanSucMsg=true'" value="返回" />
				  </div>
					
				</div>
			<div class="Main_bodyListBar_foot"></div>
		  </div>
		</div>
	
</div>
<script lanague="javascript">
 function saveUser() {
  if(Validator.Validate($('editUserForm'),3) && passwordCheck()){
    $('editUserForm').action="${base}/auth/system/saveUser.action";
    $('editUserForm').submit();
  }  
 }
 function passwordCheck(){
   var password =  $('user.password').value;
   var password1 =  $('password1').value;
   if(password != password1) {
    $('psdErrorMsg').innerHTML = '<font color="red">密码不一致,请确认!</font>';
    return false;
   }else {
   	$('psdErrorMsg').innerHTML = '';
   	return true;
   }
 } 
</script>
<@mits.footerDiv />


